package com.x.erp.service;

import com.x.erp.dao.CarMappingXyDao;
import com.x.erp.thirdparty.CarMappingXy;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import com.x.framework.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CarMappingXyService extends BaseService{
	
	@Autowired
	private CarMappingXyDao carMappingXyDao;
	
	/**
	 * 获取行圆车源车辆id
	 * @param carMappingXy
	 * @return
	 */
	public List<CarMappingXy> selectXyCarList(CarMappingXy carMappingXy){
		try {
			return carMappingXyDao.selectXyCar(carMappingXy);
		} catch (Exception e) {
			throw new BusinessException("查询行圆车辆映射数据失败！", e);
		}
	}
	
	/**
	 * 新增车源车辆id
	 * @param carMappingXy
	 * @return
	 */
	public CarMappingXy insertXyCar(CarMappingXy carMappingXy){
		try {
			return this.insert(carMappingXy);
		} catch (Exception e) {
			throw new BusinessException("新增行圆车辆映射数据失败！", e);
		}
	}

}
